<?php echo $this->Html->script(array('actions','users.view'),$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));?>
<?php echo $this->Html->css(array('users.add','form','actions'),null,array('inline'=>false));?>

<div class="users form box corners">
	<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
		<tr>
			<td colspan="2" align="center"><h2><?php echo __('Add New User')?></h2></td>
		</tr>
		<tr>
			<td align="left" valign="top" style="padding-top:0px; margin: 0px;" width="50%">
				<?php echo $this->Form->create('User',array('url'=>array('plugin'=>false,'controller'=>'users','action'=>'add_user')));?>
				<div id="tabs">
					<ul>
						<li><a href="#tabs-0">Account</a></li>
						<li><a href="#tabs-1">Billing Details</a></li>
						<li><a href="#tabs-2">Delivery Details</a></li>
					</ul>
					<div id="tabs-0">
						<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
							<tr>
								<td valign="top"><?php 
									echo $this->Form->input('email',array('label'=>__("E-mail",true)));
									echo $this->Form->input('password',array('label'=>__("Please enter your password",true),'type'=>'password'));
									echo $this->Form->input('repeat_password',array('label'=>__("Please repeat password",true),'type'=>'password'));
									?>
								</td>
								<td valign="top">
									<?php 
									echo $this->Form->input('first_name',array('label'=>__("First Name",true)));
									echo $this->Form->input('last_name',array('label'=>__("Last Name",true)));
									?>
								</td>
							</tr>
						</table>						
					</div>
					<div id="tabs-1">
						<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
							<tr>
								<td align="left" valign="top" style="padding-top:0px; margin: 0px;">
									<fieldset>
									<legend><h3><?php __("Your Billing details below"); ?></h3></legend>
									<?php
										echo $this->Form->input('address1',array('label'=>__("Address",true)));
										echo $this->Form->input('address2',array('label'=>__("Address",true)));
										echo $this->Form->input('address3',array('label'=>__("City",true)));
										echo $this->Form->input('address4',array('label'=>__("Zip Code",true)));
										//echo $this->Form->input('address5',array('label'=>__("Country",true),'options'=>$countrycod));
										
									?>
									</fieldset>
								</td>
							</tr>
						</table>
					</div>
					<div id="tabs-2">
						<table width="100%" style="padding-top:0px; margin: 0px;" cellpadding="0" cellspacing="0">
							<tr>
								<td align="left" valign="top" style="padding-top:0px; margin: 0px;">										
									<fieldset>
								 		<legend><h3><?php __('Your Delivery details below'); ?></h3></legend>
								 		<div class="input text required">
											<label for="CustomerDeliveryAsBilling"><?php echo __("Same as Billing Details?",true);?></label>
											<?php 
											echo $this->Form->checkbox('delivery_as_billing',array('hiddenField' => false)); 
											$this->Js->get('#CustomerDeliveryAsBilling');
											$this->Js->event( 'change', 'copyDelivery($("#CustomerDeliveryAsBilling").attr("checked"));' ,true);
											?>	
										</div>
										<?php									
											echo $this->Form->input('delivery_first_name',array('label'=>__("First Name",true),'class'=>'delivery_files'));
											echo $this->Form->input('delivery_last_name',array('label'=>__("Surname",true),'class'=>'delivery_files'));
											echo $this->Form->input('delivery_address1',array('label'=>__("Address",true),'class'=>'delivery_files'));
											echo $this->Form->input('delivery_address2',array('label'=>__("Address",true),'class'=>'delivery_files'));
											echo $this->Form->input('delivery_address3',array('label'=>__("City",true),'class'=>'delivery_files'));
											echo $this->Form->input('delivery_address4',array('label'=>__("Zip Code",true),'class'=>'delivery_files'));
// 											echo $this->Form->input('delivery_address5',array('label'=>__("Country",true),'class'=>'delivery_files','options'=>$countrycod));
										?>
									</fieldset>
								</td>
							</tr>
						</table>
					</div>
				</div>
				<?php echo $this->Form->end('Submit');?>
			</td>
		</tr>
	</table>
</div>
<div class="actions main_actions">
	<ul>

		<li><?php echo $this->Html->link(__('List Users', true), array('action' => 'index'));?></li>
		<li><?php echo $this->Html->link(__('List Yacht Charters', true), array('controller' => 'yacht_charters', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Yacht Charter', true), array('controller' => 'yacht_charters', 'action' => 'add')); ?> </li>
	</ul>
</div>